﻿<Menu Items="@CollapsedIconSideMenuItems" IsVertical="true" />

@code {
    private IEnumerable<MenuItem> CollapsedIconSideMenuItems { get; set; } = Enumerable.Empty<MenuItem>();

    private IEnumerable<MenuItem> GetCollapsedIconSideMenuItems()
    {
        var ret = new List<MenuItem>
        {
            new MenuItem() { Text = "系统设置", IsActive = true, Icon = "fa fa-fw fa-gears" },
            new MenuItem() { Text = "权限设置", Icon = "fa fa-fw fa-users" , IsCollapsed = true },
            new MenuItem() { Text = "日志设置", Icon = "fa fa-fw fa-database" }
        };

        ret[0].AddItem(new MenuItem() { Text = "网站设置", Icon = "fa fa-fw fa-fa" });
        ret[0].AddItem(new MenuItem() { Text = "任务设置", Icon = "fa fa-fw fa-tasks" });

        ret[1].AddItem(new MenuItem() { Text = "用户设置", Icon = "fa fa-fw fa-user" });
        ret[1].AddItem(new MenuItem() { Text = "菜单设置", Icon = "fa fa-fw fa-dashboard" });
        ret[1].AddItem(new MenuItem() { Text = "角色设置", Icon = "fa fa-fw fa-sitemap" });

        ret[2].AddItem(new MenuItem() { Text = "访问日志", Icon = "fa fa-fw fa-bars" });
        ret[2].AddItem(new MenuItem() { Text = "登录日志", Icon = "fa fa-fw fa-user-circle-o" });
        ret[2].AddItem(new MenuItem() { Text = "操作日志", Icon = "fa fa-fw fa-edit" });

        return ret;
    }

    /// <summary>
    /// OnInitialized 方法
    /// </summary>
    protected override void OnInitialized()
    {
        base.OnInitialized();
        CollapsedIconSideMenuItems = GetCollapsedIconSideMenuItems();
    }
}
